<?php

namespace app\admin\model\stock;

use think\Model;

/**
 * Stockcategory
 */
class Stockcategory extends Model
{
    // 表主键
    protected $pk = 'categoryid';
    
    // 表名
    protected $name = 'stock_stockcategory';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function stockactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'stockact', 'accountcode');
    }

    public function adjglactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'adjglact', 'accountcode');
    }

    public function issueglactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'issueglact', 'accountcode');
    }

    public function purchpricevaractTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'purchpricevaract', 'accountcode');
    }

    public function materialuseagevaracTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'materialuseagevarac', 'accountcode');
    }

    public function wipactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'wipact', 'accountcode');
    }

    public function defaulttaxcatidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Taxcategories::class, 'defaulttaxcatid', 'taxcatid');
    }
}